import request from "@/utils/request";
import type { formDataModel } from "./register";

export interface loginResModel {
	name:string,
	nickname:string,
	token:string
}

export interface userInfo {
  nickName:string
  name:string,
  [props:string]:any
}
export default{
	// 登录
	login(formData:formDataModel){
		return request.post<any,loginResModel>(`/api/user/passport/login`,formData)
	},
	// 获取用户信息
	getUserInfo(){
		return request.get<any,userInfo>(`/api/user/passport/auth/getUserInfo`)
	},
	// 退出登录
	logout(){
		return request.get<any,null>(`/api/user/passport/logout`)
	}
}
